package com.ruoyi.system.mapper;

import java.util.List;
import com.ruoyi.system.domain.ByBsSubject;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import com.alibaba.fastjson.JSONObject;

/**
 * 帮手科目关系Mapper接口
 *
 * @author ruoyi
 * @date 2023-05-31
 */
@Mapper
public interface ByBsSubjectMapper {

    @Select("select * from by_bs_subject where bsid = #{bsid}")
    List<ByBsSubject> getSubjectIdForByid(@Param("bsid") String bsid);

    @Delete("delete FROM `by_bs_subject` where `subject` = #{subject} and bsid = #{bsid}")
    int delEntityBySubjectIdAndBsId(@Param("subject") String subject,@Param("bsid") String bsid);

    @Select("SELECT * FROM `by_bs_subject` where `subject` = #{subject} and bsid = #{bsid}")
    List<JSONObject> getEntityBySubjectIdAndBsId(@Param("subject") String subject,@Param("bsid") String bsid);

    /**
     * 查询帮手科目关系
     *
     * @param id 帮手科目关系主键
     * @return 帮手科目关系
     */
    public ByBsSubject selectByBsSubjectById(Long id);

    /**
     * 查询帮手科目关系列表
     *
     * @param byBsSubject 帮手科目关系
     * @return 帮手科目关系集合
     */
    public List<ByBsSubject> selectByBsSubjectList(ByBsSubject byBsSubject);

    /**
     * 新增帮手科目关系
     *
     * @param byBsSubject 帮手科目关系
     * @return 结果
     */
    public int insertByBsSubject(ByBsSubject byBsSubject);

    /**
     * 修改帮手科目关系
     *
     * @param byBsSubject 帮手科目关系
     * @return 结果
     */
    public int updateByBsSubject(ByBsSubject byBsSubject);

    /**
     * 删除帮手科目关系
     *
     * @param id 帮手科目关系主键
     * @return 结果
     */
    public int deleteByBsSubjectById(Long id);

    /**
     * 批量删除帮手科目关系
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteByBsSubjectByIds(Long[] ids);
}
